﻿namespace question3
{
    public class MyMath
    {
        public static double Add(double a, double b)
        {
            return a + b;
        }
        public static double Subtract(double a, double b)
        {
            return a - b;
        }

        public static double Multiply(double a, double b)
        {
            return a * b;
        }
 
        public static double Divide(double a, double b)
        {
            if (b == 0)
            {
                Console.WriteLine("除数不能为0");
            }
            return a / b;
        }
    }

    public class Program
    {
        public static void Main()
        {
            double sum = MyMath.Add(5, 3);
            Console.WriteLine($"5 + 3 = {sum}");
            double difference = MyMath.Subtract(10, 4);
            Console.WriteLine($"10 - 4 = {difference}");
            double product = MyMath.Multiply(6, 7);
            Console.WriteLine($"6 × 7 = {product}");
            double quotient = MyMath.Divide(24, 4);
            Console.WriteLine($"24 ÷ 4 = {quotient}");
        }
    }

}
